<?php
class FileUploadForm extends sfForm 
{
	public function setup()
	{
		$this->setWidgets(array(
			'img'	=> new sfWidgetFormInputFile(),
			'itype'   =>new sfWidgetFormInputHidden(),
			));
		$this->widgetSchema->setLabels(
		array('img'	=> '图片'));
		$this->validatorSchema['img'] = new sfValidatorFile(
  		array(  'required'=>true,
  				'mime_types'=>'web_images')
  		);
  		$this->validatorSchema['itype'] = new sfValidatorFile(
  		array('required'=>false)
  		);
  		$this->widgetSchema->setNameFormat('cate[%s]');
  		//$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
   }
}